// const { XRShadow } = require("XrFrame/elements");

// pages/sousuo/pyy/pyy.js
const app =getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    pageNo:1,
    consContent:'',
    total:2,
    isLoading:false,
    url:'',
    Consultlist:'',
    specialtiesList:'',
    chargetypeconsult:'',
    chargeconsult:'',
    userpingjia:'',
    courselist:'',
    did:'',
    Consultlist2:'',
    userid:''
    

  },

//   getData(){
 
      
 
//     let that = this
//     console.log("yyyy"+this.data.url)
//     wx.request({
      
//       method:'GET',
//       url: that.data.url+'ConsultController/getConsultList',
//       //?channelId=409&pageNo=1&pageSize=15
//       data:{
   
//         pageNum:that.data.pageNo,
//         pageSize:15
//       },
//       success(res){
//         console.log(res.data);
//         let data = res.data.data
//         that.setData({
//           pageNo:that.data.pageNum+1,
//           consContent:[...that.data.consContent,...data.list],
//           total:data.total
//         })
//         // console.log(that.data.consContent)
//       },
     
//     })
//   },


zixun(){
    let that=this
    wx.request({
        method:'post',
      url: 'http://10.10.18.137:8888/sfzy/appointment/insert',
      data:{
        typeId:that.data.Consultlist2.specialties[0].id,
        content:that.data.Consultlist2.intro,
        consultId:that.data.Consultlist2.id,
        userId:that.data.userid,
        status:0
      },
      success(resp){
      
          console.log("成功")
        
      }

    })




},


  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
      let that=this
    that.setData({
        url:app.globalData.URL,
        did:options.id,
        userid:app.globalData.userInfo.id
        

    })
    let id=options.id
    let name=options.name
    console.log(id)
    wx.request({
        method:'GET',
      url: that.data.url+'ConsultController/findById',
      data:{
          id:id,
          pageNum:1,
          pageSize:5
 
      },
      
      
      success(resp){
        console.log('jjj'+resp.data)
          that.setData({
            Consultlist:resp.data.data.list[0]
          
          })
      }

    })


    wx.request({
        method:'GET',
      url: that.data.url+'ConsultController/getConsultList',
      data:{
          id:id,
          pageNum:1,
          pageSize:5
      },
      success(resp){
      
          that.setData({
            Consultlist2:resp.data.data.list[0]
          })
      }

    })

    wx.request({
        method:'GET',
      url: that.data.url+'chargetype/selectByconsultid',
      data:{
        consultid:id,
      },
      
      
      success(resp){
      
          that.setData({
            chargetypeconsult:resp.data.data
        
          
          })
          console.log(resp.data.data)
      }

    })


    wx.request({
        method:'GET',
      url: that.data.url+'charge/selectByConsultId',
      data:{
        consultId:id,
      },
      success(resp){
      
          that.setData({
            chargeconsult:resp.data.data
        
          
          })
          console.log(resp.data.data)
      }

    })


    wx.request({
        method:'GET',
      url: 'http://10.10.18.137:8888/sfzy/usermark/selectByConsultId',
      data:{
        consultId:id,
      },
      success(resp){
      
          that.setData({
            userpingjia:resp.data.data
        
          })
          console.log(resp.data.data)
          console.log(resp.data.data)
      }

    })


    wx.request({
        method:'GET',
      url: that.data.url+'course/selectByTeacherIdCourses',
      data:{
        teacherId:id,
      },
      success(resp){
      
          that.setData({
            courselist:resp.data.data.list
        
          
          })
          console.log(resp.data.data)
      }

    })



   




   
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})